#!/usr/bin/env python
# encoding: utf-8

#  Copyright (c) 2007 Freight Logistics, Inc.
#  Author Ryan Parrish <rparrish@freightlogistics.com>
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

import Pyro.core

from configobj import ConfigObj

import svcs

class ServoyVCSPyro(Pyro.core.SynchronizedObjBase, svcs.ServoyVCS):
    def __init__(self, config):
        Pyro.core.SynchronizedObjBase.__init__(self)
        svcs.ServoyVCS.__init__(self, config)

config = ConfigObj('config.cfg')
Pyro.core.initServer()
daemon=Pyro.core.Daemon()
uri=daemon.connect(ServoyVCSPyro(config), "solution")

print "The daemon runs on port:",daemon.port
print "The object's uri is:",uri

daemon.requestLoop()
